package com.zsjt.app.controller;

import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping;

import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
public class SessionController {
    /**
     * 会话超时
     * @return
     */
    @GetMapping("/session/invalid")
    @ResponseStatus(code = HttpStatus.UNAUTHORIZED)
    public String sessionTimeOut(HttpServletRequest request){
        System.out.println("会话超时");
        return "会话超时";
//        request.setAttribute("sessionTimeout",1);
//        return "forward:/main";
    }
}
